package com.acme.bankapp.domain.bank;

import com.acme.bankapp.domain.bank.exceptions.NotEnoughFundsException;

/**
 * @author Artem Kalchenko
 *
 */
public interface Account {
	/**
	 * Return account's balance
	 * @return balance
	 */
	double getBalance();

	/**
	 * Deposit money on the account
	 * @param sum
	 * @return new balance state
	 * @throws IllegalArgumentException TODO
	 */
	double deposit(double sum) throws IllegalArgumentException;

	/**
	 * Withdraw sum from the account
	 * @param sum
	 * @throws NotEnoughFundsException
	 */
	void withdraw(double sum) throws NotEnoughFundsException;

	/**
	 * Return maximum amount a client can withdraw
	 * @return
	 */
	double maximumAmountToWithdraw();
	
	/**
	 * Set a client associated with the account
	 * @param client
	 */
	void setClient(Client client);
	
	/**
	 * Return a client associated with the account
	 * @return
	 */
	Client getClient();
	
	/**
	 * Return rounded value of the balance
	 * @return
	 */
	long decimalValue ();
	}
